/**
 * 权限相关的数据
 * Created by gcc on 2017/9/29.
 */

// 页码相关
let page = {
  total: 1,
  startIndex: 0,
  stepNumber: 20,
  currentPage: 1
};

//页面状态相关
let status = {
  //新建文件夹
  modalFolder: {
    isShow: false,
    isLoading: true,
  },
  //删除文件夹或者文件的 modal
  modalDelete: {
    isShow: false,
    isLoading: false,
    folder: {
      objectIds:[],
      type:1,//1目录 2文件
      name:''//待删除的名称
    }
  },
  //是否为单选
  isSingle:true,
  //是否可以选择单选多选
  showChooseSingle:false,
  spinLoading:false,
  refreshChecked:true,
  //目录层级 {foderId,folderType,level,foderName}
  breadcrumbList:[],
  rules: {
    name: [
      {required: true, message: '文件夹名称不能为空', trigger: 'blur'}
    ],
  },
};

// 和网络交互相关的参数
let params = {
  //搜索条件
  folderName: '',
  orderBy:'',
  folderType:0,//目录的类型，只限一级目录 1: 产品 2：模特 3：活动 4:标签 5：分类
  singleImage:'',
  checkedImages:[],
  //下级目录列表的条件
  folderList:{
    folderType:0,//1:产品类型图片目录
    productCode:'',
    folderName:'',
    foderId:'',
    keyCode:'',//关键字
    orderList:'',//排序
    level:'',//排序
  },
  //新建文件夹
  folder:{
    parentId:'',
    name:''
  },
  uploadFolderParam: {},
  uploadParam: {
    folderId: "",
    picSizes: [],
  },
};

// 页面的数据源
let data = {
  //folderTreeData 的结构
  // title: item.name,
  // name: item.name,
  // expand: false,
  // id: item.id,
  // level: item.level,
  // parentId: item.parentId,
  // parentName: item.parentName,
  folderTreeData: [],
  folderList: [],
  selectedFolderList:[]
};

let role = {
  userAddress: false,
  userCart: false,
  userOrder: false,
};

export  default  {
  tPage: page,
  tStatus: status,
  tParams: params,
  tData: data,
  tRole: role
};
